package com.example.leetcode.graph;

import com.example.leetcode.graph.common.GraphUtils;

class Solution1615 {
    public int maximalNetworkRank(int n, int[][] roads) {
        return GraphUtils.maximalNetworkRank(n, roads);
    }
}

public class leetcode1615 {
    public static void main(String[] args) {
        Solution1615 solution1615 = new Solution1615();

        int n = 4;
        int[][] roads = {{0, 1}, {0, 3}, {1, 2}, {1, 3}};
        System.out.println(solution1615.maximalNetworkRank(n, roads));

        int n1 = 5;
        int[][] roads1 = {{0, 1}, {0, 3}, {1, 2}, {1, 3}, {2, 3}, {2, 4}};
        System.out.println(solution1615.maximalNetworkRank(n1, roads1));

        int n2 = 8;
        int[][] roads2 = {{0, 1}, {1, 2}, {2, 3}, {2, 4}, {5, 6}, {5, 7}};
        System.out.println(solution1615.maximalNetworkRank(n2, roads2));

        int n3 = 2;
        int[][] roads3 = {};
        System.out.println(solution1615.maximalNetworkRank(n3, roads3));
    }
}
